/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-content {
    position: relative;
    background-color: white;
    border-radius: 10px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.modal-header h3 {
    color: #2d3436;
    font-size: 20px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #95a5a6;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #ff6b6b;
}

.modal-body {
    padding: 25px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2d3436;
    font-weight: 500;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background-color: white;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.form-group input::placeholder {
    color: #95a5a6;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.form-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #636e72;
    font-weight: normal;
}

.form-options input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.forgot-password {
    color: #ff6b6b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #ee5253;
    text-decoration: underline;
}

.full-width {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #636e72;
}

.form-footer a {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: #ee5253;
    text-decoration: underline;
}

/* 用户资料样式 */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background-color: #f8f9fa;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.user-profile:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #fff;
    padding: 2px;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar:hover {
    border-color: #ffc107;
    transform: scale(1.05);
}

.user-avatar svg {
    width: 100%;
    height: 100%;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.logout-btn {
    font-size: 12px;
    padding: 6px 12px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.logout-btn:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

/* 响应式调整 */
@media (max-width: 576px) {
    .user-profile {
        gap: 8px;
        padding: 6px 12px;
    }
    
    .user-name {
        display: none;
    }
    
    .logout-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* 响应式表单调整 */
@media (max-width: 576px) {
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .form-options a {
        align-self: flex-end;
    }
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.primary-btn {
    background-color: #ff6b6b;
    color: white;
}

.primary-btn:hover:not(:disabled) {
    background-color: #ee5253;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3);
}

.secondary-btn {
    background-color: #4ecdc4;
    color: white;
}

.secondary-btn:hover:not(:disabled) {
    background-color: #45b7aa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(78, 205, 196, 0.3);
}

/* 导航栏 */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #ff6b6b;
}

.logo i {
    margin-right: 10px;
    font-size: 32px;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #ff6b6b;
}

.user-actions {
    display: flex;
    gap: 15px;
}

.login-btn {
    background-color: transparent;
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

.login-btn:hover {
    background-color: #ff6b6b;
    color: white;
}

.register-btn {
    background-color: #ff6b6b;
    color: white;
}

.hamburger {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
}

/* 首页英雄区域 */
.hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 80px 0;
    margin-bottom: 40px;
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-content {
    flex: 1;
    max-width: 500px;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #2d3436;
    line-height: 1.2;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #636e72;
}

.cta-buttons {
    display: flex;
    gap: 20px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.svg-image {
    width: 100%;
    max-width: 500px;
    height: auto;
}

/* 今日育儿Tip */
.daily-tip {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.tip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tip-header h3 {
    color: #ff6b6b;
    font-size: 20px;
    display: flex;
    align-items: center;
}

.tip-header h3 i {
    margin-right: 10px;
    font-size: 24px;
}

.date {
    color: #95a5a6;
    font-size: 14px;
}

.tip-content p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.read-more {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #ee5253;
    text-decoration: underline;
}

/* 精选专题 */
.featured-topics {
    margin-bottom: 80px;
}

.featured-topics h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #2d3436;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.topic-card {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.topic-card img {
    max-width: 100px;
    margin-bottom: 20px;
}

.topic-card h3 {
    margin-bottom: 15px;
    color: #2d3436;
}

.topic-card p {
    color: #636e72;
    margin-bottom: 20px;
}

.view-topic {
    display: inline-block;
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 20px;
    border: 1px solid #ff6b6b;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.view-topic:hover {
    background-color: #ff6b6b;
    color: white;
}

/* 文章中心 */
.article-center {
    background-color: white;
    border-radius: 10px;
    padding: 40px;
    margin-bottom: 80px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.article-center h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #2d3436;
}

.article-section {
    margin-bottom: 40px;
}

.article-section h3 {
    margin-bottom: 20px;
    color: #2d3436;
    font-size: 20px;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 8px 20px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background-color: #e9ecef;
}

.tab-btn.active {
    background-color: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.category-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    background-color: #e9ecef;
    transform: translateY(-3px);
    border-color: #ff6b6b;
}

.category-card i {
    font-size: 32px;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.recommended-articles h3 {
    margin-bottom: 20px;
    color: #2d3436;
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.article-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.article-item:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

.article-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.article-info {
    flex: 1;
}

.article-info h4 {
    margin-bottom: 10px;
    color: #2d3436;
    line-height: 1.4;
}

.article-info p {
    color: #636e72;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #95a5a6;
}

.load-more {
    display: block;
    margin: 0 auto;
    background-color: transparent;
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

.load-more:hover {
    background-color: #ff6b6b;
    color: white;
}

/* 功能介绍 */
.features {
    margin-bottom: 80px;
}

.features h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    color: #2d3436;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.feature-card i {
    font-size: 48px;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: #2d3436;
}

.feature-card p {
    color: #636e72;
}

/* 社区互动 */
.community {
    background-color: white;
    border-radius: 10px;
    padding: 40px;
    margin-bottom: 80px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.community h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 32px;
    color: #2d3436;
}

.community-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.community-posts {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.post-item {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.post-item:hover {
    background-color: #e9ecef;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: #ff6b6b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.user-info h4 {
    color: #2d3436;
}

.user-info p {
    color: #95a5a6;
    font-size: 14px;
}

.post-content h4 {
    margin-bottom: 10px;
    color: #2d3436;
}

.post-content p {
    color: #636e72;
    margin-bottom: 15px;
}

.post-stats {
    display: flex;
    gap: 20px;
    color: #95a5a6;
    font-size: 14px;
}

.post-stats i {
    margin-right: 5px;
}

.create-post-btn {
    display: block;
    margin: 0 auto;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff9ff3 100%);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
    text-align: center;
}

.newsletter h2 {
    font-size: 32px;
    margin-bottom: 15px;
}

.newsletter p {
    font-size: 18px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.newsletter-form input {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    flex: 1;
    min-width: 250px;
}

/* APP提醒 */
.app-notify {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 60px;
    text-align: center;
}

.app-notify h3 {
    color: #2d3436;
    margin-bottom: 10px;
}

.app-notify p {
    color: #636e72;
    margin-bottom: 20px;
}

.app-notify-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

.app-notify-form input {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    flex: 1;
    min-width: 250px;
}

/* 页脚 */
.footer {
    background-color: #2d3436;
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}

.footer-logo i {
    margin-right: 10px;
    font-size: 32px;
}

.footer-links h4,
.footer-contact h4,
.footer-social h4 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ff6b6b;
}

.footer-contact p {
    margin-bottom: 10px;
    color: #bdc3c7;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-right: 10px;
    color: #ff6b6b;
}

.social-icons {
    display: flex;
    gap: 20px;
}

.social-icons a {
    color: white;
    font-size: 24px;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: #ff6b6b;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* AI聊天窗口 */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 350px;
    max-width: 90vw;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background-color: #ff6b6b;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-header:hover {
    background-color: #ee5253;
}

.chat-icon {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.chat-icon i {
    color: #ff6b6b;
    font-size: 20px;
}

.chat-title h4 {
    font-size: 16px;
    margin-bottom: 2px;
}

.chat-title p {
    font-size: 12px;
    opacity: 0.9;
}

.chat-toggle {
    margin-left: auto;
}

.chat-container {
    height: 400px;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.message {
    margin-bottom: 20px;
    max-width: 80%;
}

.ai-message {
    margin-right: auto;
}

.user-message {
    margin-left: auto;
}

.message-content {
    padding: 12px 16px;
    border-radius: 15px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-message .message-content {
    background-color: #4ecdc4;
    color: white;
}

.chat-input-container {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
}

#chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    margin-right: 10px;
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4ecdc4;
    color: white;
    padding: 0;
}

.send-btn:hover:not(:disabled) {
    background-color: #45b7aa;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        margin-bottom: 40px;
    }
    
    .cta-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .user-actions {
        display: none;
    }
    
    .hamburger {
        display: block;
    }
    
    .category-tabs {
        justify-content: center;
    }
    
    .article-item {
        flex-direction: column;
        text-align: center;
    }
    
    .article-item img {
        margin: 0 auto;
    }
    
    .chat-widget {
        width: 90vw;
        right: 5vw;
        bottom: 20px;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 36px;
    }
    
    .features-grid,
    .topics-grid,
    .category-cards {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form input,
    .app-notify-form input {
        min-width: 100%;
    }
    
    .chat-container {
        height: 350px;
    }
}